package cn.edu.scnu.semart.order.feign;

import cn.edu.scnu.semart.model.cart.CartItemDTO;
import io.swagger.models.auth.In;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(name = "service-cart", path = "/cart")
public interface CartFeignClient {
    @GetMapping("/getUserCart/{userId}")
    Map<String, Object> getUserCart(@PathVariable("userId") Integer userId);

    // 新增: 直接获取购物车项列表的方法
    @GetMapping("/getCartItems/{userId}")
    List<CartItemDTO> getCartItems(@PathVariable("userId") Integer userId);

    @DeleteMapping("/deleteAll")
    void batchDelete(@RequestBody List<Integer> cartIds);
}